package generadorDescriptores.dom;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class FacttableDom {
	Element facttable;
	Document document;
	
	
	public FacttableDom(Document doc){
		this.document = doc;
		this.facttable = doc.createElement("facttable");
		
	}
	
	public void setAttributes(String table, String metric, String type, String formatter){
		facttable.setAttribute("table", table);
		facttable.setAttribute("metric", metric);
		facttable.setAttribute("type", type);
		facttable.setAttribute("formatter", formatter);
	}
	
	public void setCurrencyType(String currencyType){
		facttable.setAttribute("currency", currencyType);
	}
	
	public void addJoins(JoinsDom joins){
		this.facttable.appendChild(joins.getElement());
	}
	
	public void addDimensions(DimensionsDom dimensions){
		this.facttable.appendChild(dimensions.getElement());
	}

	public Element getElement() {
		return this.facttable;
	}
		
}
